package com.example.test_system.service;

import com.example.test_system.mapper.UserMapper;
import com.example.test_system.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    public boolean login(User user) {
        User user1 = userMapper.find_user(user.getUsername(), user.getPassword());
        if(user1 == null) {
            return false;
        }
        return true;
    }

    public boolean register(User user){
        userMapper.insert_user(user);
        return true;
    }

}
